package controlador;

import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import modelo.*;
import vista.*;
import controlador.*;

public class ControlFramePrincipal  implements ActionListener{
	
	private FramePrincipal fp;
	
	public ControlFramePrincipal()
	{
		super();
		this.fp = new FramePrincipal();
		this.fp.addListener(this);
		this.fp.setVisible(true);
		fp.setLocationRelativeTo(null);
	}
	
	public void actionPerformed(ActionEvent e)
    {
		if (e.getActionCommand().equals("Categoria"))
			new ControlCategoria();
    	else if (e.getActionCommand().equals("Producto"))
    		new ControlProducto();
    	else if (e.getActionCommand().equals("Cliente"))
    		new ControlCliente();
    	else if (e.getActionCommand().equals("Proveedor"))
    		new ControlProveedor();
    	else if (e.getActionCommand().equals("Ingrediente"))
    		new ControlIngrediente();
    	else if (e.getActionCommand().equals("Orden de Pedido"))
    		new ControlFacturaV();
    	else if (e.getActionCommand().equals("Registrar Compra"))
    		new ControlFacturaC();
    	else if (e.getActionCommand().equals("Cantidad"))
    		new ControlReporte(1);
    	else if (e.getActionCommand().equals("Monto"))
    		new ControlReporte(3);
    	else if (e.getActionCommand().equals("Ingredientes mas Usados"))
    		new ControlReporte(2);
    	else if (e.getActionCommand().equals("Salir"))
    		fp.dispose();
    }

}
